package com.yaoq.observer.improve;

/**
 * @ClassName Client
 * @Description TODO
 * @Author yaoqiang
 * @Date 2020/9/3 14:45
 * @Version 1.0
 */
public class Client {
    public static void main(String[] args) {
        //创建一个weatherdata
        WeatherData weatherData = new WeatherData();
        //创建观察者
        CurrentConditions currentConditions = new CurrentConditions();

        BaiduSite baiduSite = new BaiduSite();

        //注册到weatherData
        weatherData.registerObserver(currentConditions);
        weatherData.registerObserver(baiduSite);

        //测试
        System.out.println("通知各个观察者看看信息");
        weatherData.setData(10f, 100f, 30.3f);


    }
}
